package com.youlai.boot.modules.game.model.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 游戏表单
 *
 * @author 有来技术团队
 */
@Schema(description = "游戏表单")
@Data
public class GameInfoForm {

    @Schema(description = "游戏ID")
    private Long id;

    @Schema(description = "游戏名称")
    @NotBlank(message = "游戏名称不能为空")
    private String name;

    @Schema(description = "游戏描述")
    private String description;

    @Schema(description = "封面图片")
    @NotBlank(message = "封面图片不能为空")
    private String coverImage;

    @Schema(description = "Banner图片")
    private String bannerImage;
    
    @Schema(description = "游戏分类")
    @NotNull(message = "游戏分类不能为空")
    private Long category;

    @Schema(description = "游戏标签ID列表")
    private List<Long> tagIds;

    @Schema(description = "游戏开发商")
    private String developer;

    @Schema(description = "游戏发行商")
    private String publisher;

    @Schema(description = "发布日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate releaseDate;

    @Schema(description = "游戏价格")
    @DecimalMin(value = "0.0", message = "价格不能小于0")
    private BigDecimal price;

    @Schema(description = "折扣价格")
    @DecimalMin(value = "0.0", message = "折扣价格不能小于0")
    private BigDecimal discountPrice;

    @Schema(description = "折扣开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime discountStart;

    @Schema(description = "折扣结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime discountEnd;

    @Schema(description = "评分(1-5)")
    @DecimalMin(value = "1.0", message = "评分不能小于1")
    @DecimalMax(value = "5.0", message = "评分不能大于5")
    private BigDecimal rating;

    @Schema(description = "评分人数")
    private Integer ratingCount;

    @Schema(description = "下载次数")
    private Integer downloadCount;

    @Schema(description = "游戏大小(MB)")
    private Integer size;

    @Schema(description = "游戏版本")
    private String version;

    @Schema(description = "最低年龄要求")
    private Integer minAge;
    
    @Schema(description = "游戏状态(0-下架，1-上架)", defaultValue = "1")
    private Integer status = 1;

    @Schema(description = "排序号", defaultValue = "0")
    private Integer sort = 0;

    @Schema(description = "是否推荐(0-否，1-是)", defaultValue = "0")
    private Integer featured = 0;

    @Schema(description = "是否热门(0-否，1-是)", defaultValue = "0")
    private Integer hot = 0;

    @Schema(description = "是否新品(0-否，1-是)", defaultValue = "0")
    private Integer newGame = 0;
    
    @Schema(description = "游戏截图列表")
    private List<GameScreenshotForm> screenshots;
} 